commands/ls: Fix NULL dereference
authorB Horn <b@horn.uk>
Sun, 12 May 2024 10:08:23 +0000 (11:08 +0100)
committerFelix Zielcke <fzielcke@z-51.de>
Thu, 3 Jul 2025 16:35:51 +0000 (18:35 +0200)
commit5e21354d3b59f8cc920df0f6f13cc6c0b97999d8
tree301408f114f7d93f57bba3435f3be839c580d090
parent4ccb621c7d343694d5c3bf2e5a59983923296322
commands/ls: Fix NULL dereference

The grub_strrchr() may return NULL when the dirname do not contain "/".
This can happen on broken filesystems.

Reported-by: B Horn <b@horn.uk>
Signed-off-by: B Horn <b@horn.uk>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Gbp-Pq: Topic cve-2025-jan
Gbp-Pq: Name commands-ls-Fix-NULL-dereference.patch
grub-core/commands/ls.c